import rxAjax from '@/assets/js/ajax.js';

//密码安全策略管理配置 api接口
export const OsPasswordPolicyApi = {};

OsPasswordPolicyApi.baseUrl= '/api-user/user/org/osPasswordPolicy';
OsPasswordPolicyApi.exportUrl= OsPasswordPolicyApi.baseUrl + '/listExport';

//查询列表
OsPasswordPolicyApi.query=function (parameter) {
  var url= OsPasswordPolicyApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
OsPasswordPolicyApi.get =function(pkId) {
  var url= OsPasswordPolicyApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
OsPasswordPolicyApi.save =function(parameter) {
  var url= OsPasswordPolicyApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
OsPasswordPolicyApi.del =function(parameter) {
  var url= OsPasswordPolicyApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

//或者数据
OsPasswordPolicyApi.getPasswordPolicy =function() {
    var url= OsPasswordPolicyApi.baseUrl + '/getPasswordPolicy';
    return rxAjax.get(url);
}

//保存或者修改操作
OsPasswordPolicyApi.saveOrUpdateConfig =function(parameter) {
    var url= OsPasswordPolicyApi.baseUrl + '/saveOrUpdateConfig';
    return rxAjax.postJson(url,parameter);
}

export  default OsPasswordPolicyApi;

